package com.test.dp.simplefactory;

public class Driver {
	public static Car dirverCar(String s) throws Exception{
		if(s.equalsIgnoreCase("Benz"))
			return new Benz();
		else if(s.equalsIgnoreCase("Bmw"))
			return new Bmw();
		else if(s.equalsIgnoreCase("Audi"))
			return new Audi();
		else throw new Exception();
			
	}

}
